from selenium import webdriver
from selenium.webdriver.common.by import By

wd=webdriver.Chrome()
wd.get("http://www.baidu.com")
a=wd.find_element(By.ID,"kw")
print(a)
print(a.get_attribute('text'))